<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body,img{
            margin: 0;
            padding: 0;
        }
        img{
            border: 0;
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body>
    <h1>恭喜你中奖了</h1>
    <img src="./img/adver.jpg" alt="" srcset="">
    <a href="javascript:history.back()">返回主页面</a>
    <a href="javascript:history.go(-1)">返回主页面</a>

    <script>

        let reUrl = document.referrer
        console.log(reUrl);
        if(reUrl==""){
            alert("非法访问，中奖无效");
            setTimeout("location.href='./07-document对象.html'",1000)
            // setTimeout(动作事件，对应的毫秒数)====执行一次
            //   let a = setTimeout(alert("1111111"),3000)
            //   clearTimeout(a)
            // setInterval(动作事件，重复的周期毫秒)======重复执行
                // let b=setInterval(alert("1111"),3000)
                // clearInterval(b)
        }else{
            
        }
        
    </script>
    
</body>
</html>